Optimal. Leaf size=224 \[ \frac{\left (8 a^2 A+4 a b B-3 A b^2\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{4 a^{5/2} d}+\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}-\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.80705, antiderivative size = 224, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 8, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.242, Rules used = {3609, 3649, 3653, 3539, 3537, 63, 208, 3634} \[ \frac{\left (8 a^2 A+4 a b B-3 A b^2\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{4 a^{5/2} d}+\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}-\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3609
Rule 3649
Rule 3653
Rule 3539
Rule 3537
Rule 63
Rule 208
Rule 3634
Rubi steps
\begin{align*} \int \frac{\cot ^3(c+d x) (A+B \tan (c+d x))}{\sqrt{a+b \tan (c+d x)}} \, dx &=-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}-\frac{\int \frac{\cot ^2(c+d x) \left (\frac{1}{2} (3 A b-4 a B)+2 a A \tan (c+d x)+\frac{3}{2} A b \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 a}\\ &=\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}+\frac{\int \frac{\cot (c+d x) \left (\frac{1}{4} \left (-8 a^2 A+3 A b^2-4 a b B\right )-2 a^2 B \tan (c+d x)+\frac{1}{4} b (3 A b-4 a B) \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 a^2}\\ &=\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}+\frac{\int \frac{-2 a^2 B+2 a^2 A \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 a^2}-\frac{\left (8 a^2 A-3 A b^2+4 a b B\right ) \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{8 a^2}\\ &=\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}+\frac{1}{2} (-i A-B) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx+\frac{1}{2} (i A-B) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx-\frac{\left (8 a^2 A-3 A b^2+4 a b B\right ) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{8 a^2 d}\\ &=\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}+\frac{(A-i B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}+\frac{(A+i B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}-\frac{\left (8 a^2 A-3 A b^2+4 a b B\right ) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{4 a^2 b d}\\ &=\frac{\left (8 a^2 A-3 A b^2+4 a b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{4 a^{5/2} d}+\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}-\frac{(i A-B) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}+\frac{(i A+B) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=\frac{\left (8 a^2 A-3 A b^2+4 a b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{4 a^{5/2} d}-\frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{\sqrt{a-i b} d}-\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{\sqrt{a+i b} d}+\frac{(3 A b-4 a B) \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{4 a^2 d}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{2 a d}\\ \end{align*}
Mathematica [A] time = 6.26077, size = 362, normalized size = 1.62 \[ \frac{2 b^3 \left (-\frac{3 A \left (\frac{\tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{3/2}}-\frac{\cot (c+d x) \sqrt{a+b \tan (c+d x)}}{a b}\right )}{8 a b}+\frac{B \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{2 a^{3/2} b^2}-\frac{\left (A \sqrt{-b^2}+b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )}{2 b^3 \sqrt{-b^2} \sqrt{a-\sqrt{-b^2}}}-\frac{b \left (A \sqrt{-b^2}-b B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )}{2 \left (-b^2\right )^{5/2} \sqrt{a+\sqrt{-b^2}}}+\frac{A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} b^3}-\frac{A \cot ^2(c+d x) \sqrt{a+b \tan (c+d x)}}{4 a b^3}-\frac{B \cot (c+d x) \sqrt{a+b \tan (c+d x)}}{2 a b^3}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 2.191, size = 111109, normalized size = 496. \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (A + B \tan{\left (c + d x \right )}\right ) \cot ^{3}{\left (c + d x \right )}}{\sqrt{a + b \tan{\left (c + d x \right )}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \cot \left (d x + c\right )^{3}}{\sqrt{b \tan \left (d x + c\right ) + a}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]